From: cl349@firebug.cl.cam.ac.uk Date: Tue, 13 Sep 2005 10:05:49 +0000 (+0000) Subject: Prevent opening the xenbus device if the store isn't connected yet. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16812^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=398a3f5679a670c0901961137d32d447b2bc90b8;p=xen.git Prevent opening the xenbus device if the store isn't connected yet. Running xenstore clients using the xenbus device before the store connection has been set up causes a crash because the store page won't have been allocated yet. This is only a problem in dom0 where we setup the store page from the PRIVCMD_INITDOMAIN_STORE ioctl. Signed-off-by: Christian Limpach --- diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c index fd5ab73fe9..c5bdeb4e8c 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c @@ -130,6 +130,9 @@ static int xenbus_dev_open(struct inode *inode, struct file *filp) { struct xenbus_dev_data *u; + if (xen_start_info->store_evtchn == 0) + return -ENOENT; + /* Don't try seeking. */ nonseekable_open(inode, filp);